package com.example.mallproduct.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.common.utils.PageUtils;
import com.example.mallproduct.controller.vo.Catalog2VO;
import com.example.mallproduct.entity.CategoryEntity;
import com.fasterxml.jackson.core.JsonProcessingException;

import java.io.IOException;
import java.util.List;
import java.util.Map;

/**
 * 商品三级分类
 *
 * @author charlie
 * @email @gmail.com
 * @date 2023-11-26 14:55:58
 */
public interface CategoryService extends IService<CategoryEntity> {

    PageUtils queryPage(Map<String, Object> params);

    /**
     * 获取类别 tree
     * @param params
     * @return
     */
    List<CategoryEntity> getCategoryTree();

    /**
     * 逻辑删除类别
     * @param ids
     */
    void removeCategoryByIds(List<Long> ids);

    /**
     * 查询一级分类
     * @return
     */
    List<CategoryEntity> getLeve1Category();

    /**
     * 查询二三级分类
     * @return
     */
    Map<String, List<Catalog2VO>> getCatelog2JSON() throws IOException;
}

